﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SocialNetwork.Models
{
    public class FotoModel
    {
        
        DBModel dbModel=new DBModel();
        aMembershipProvider a=new aMembershipProvider();
       
        UserRepository repository=new UserRepository();
        public List<Album> Albums { get;private set; } 

        public FotoModel(Guid userId)
        {
            
            Albums = GetAllAlbums(userId);
            
        }
        private List<Album> GetAllAlbums(Guid userId)
        {
            return new List<Album>(dbModel.Album.Where(u => u.UserId == userId));
        } 
        public List<Photo> GetAllPhotosForAlbum(Album album)
        {
            
            return new List<Photo>(dbModel.Photo.Where(ph=>ph.AlbumId==album.Id));
        } 


    }
}